
package com.awenhui.demo.model;


import lombok.Getter;
import lombok.Setter;

/*
 * @description: 返回类型封装类
 * @author: yuxf
 * @date: 2020-04-20 14:23:43
 */
public class BaseResult<T> {
    /**
     * 消息
     */
    @Getter
    @Setter
    private String message;

    /**
     * 返回结果类型
     */
    @Getter
    @Setter
    private ResultType resultType;

    /**
     * 返回数据
     */
    @Getter
    @Setter
    private T data;

    public BaseResult(T data, ResultType resultType) {
        this.data = data;
        this.resultType = resultType;
    }

    public static <T> BaseResult<T> success(T data) {
        return new BaseResult<T>(data, ResultType.BUSINESS_SUCCESS);
    }

    public static  BaseResult<String> success() {
        return new BaseResult<String>("", ResultType.BUSINESS_SUCCESS);
    }


    

  

}